﻿@using Web.Models
@model List<Web.Models.News>
@{
    ViewBag.Title = "新闻资讯";
    List<Category> categoryList = ViewBag.CategoryList ?? new List<Category>();
}

@section head{
    <link href="~/content/css/about.min.css" rel="stylesheet" />
    <link href="~/content/css/about.mobile.min.css" rel="stylesheet" />
}

<div class="banner"></div>

<div class="about-main" style="overflow: hidden">
    <div class="nav">
        <ul>
            @foreach (var item in categoryList)
            {
                <li @Html.Raw(item.Id == ViewBag.CategoryId ? "class=\"active\"" : "")>
                    <a href="@Url.Action("Index",new{CategoryId=item.Id})">@item.CategoryName</a>
                </li>
            }
        </ul>
    </div>

    <div class="news-list clearfix">
        <ul>
            @foreach (var item in Model)
            {
                <li>
                    <a href="@Url.Action("Detail",new{item.Id})">
                        <div class="time"><span class="t1">@item.CreateTime.ToString("MM-dd")</span><span class="t2">@item.CreateTime.Year</span></div>
                        <div class="title">@Html.Raw(item.Title)</div>
                        <div class="subtitle">@item.SubTitle</div>
                    </a>
                </li>
            }
        </ul>
    </div>
</div>